package com.datacloud.dao;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.datacloud.bean.RoutesBean;
import com.datacloud.bean.TiresBean;



/**
 * 
 * 轮胎数据库操作接口类
 * 
 **/
public interface TiresDao{
	//获取轮胎信息
	TiresBean findTiresBy (@Param("epc") String epc,@Param("vehicleid") String vehicleid,@Param("wheelaliasid") String wheelaliasid);
	//进行轮胎绑定
	int bindingTire(TiresBean info);
	//轮胎检查

	int updateTireCheckinfo(@Param("tireid") int tireid,@Param("depth")int detpth);
//	在车操作的轮位操作
	int updateCarsTrieCheck(@Param("id") int id,@Param("depth")int depth);
//	库存盘点
	List<Map<String,Object>>inventoryTireInfo(@Param("stockid")int stockid);
//	翻新盘点
	List<Map<String,Object>>recappedTireInfo(@Param("stockid")int stockid);
//	车辆轮胎盘点
	List<Map<String,Object>>findLoadTrie(@Param("stockid")int stockid);
//	卸下轮胎入库
	int updateUnloadTireBy(@Param("id")int id,@Param("stockid")int stockid);
	//通过装上轮胎epc查找装上轮胎id
	int getInstallIdByEpc(@Param("installepc")String installepc);
	//通过卸下轮胎epc查找卸下轮胎id
	int getUnloadIdByEpc(@Param("unloadepc")String unloadepc);

	int updateTire(@Param("installid") int installid,@Param("unloadid")int unloadid,
				   @Param("vehicleid")int vehicleid,@Param("wheelid")int wheelid,
				   @Param("stockid")int stockid);
	//	通过轮位1轮胎的epc获取轮胎1id
	int getTire1IdByEpc(@Param("tire1epc")String tire1epc);
	//	通过轮位2轮胎的epc获取轮胎2id
	int getTire2IdByEpc(@Param("tire2epc")String tire2epc);

	int exchangeWheel1(@Param("tire1id") int tire1id, @Param("vehicleid")int vehicleid, @Param("wheel2id")int wheel2id);

	int exchangewheel2(@Param("tire2id") int tire2id,@Param("vehicleid")int vehicleid, @Param("wheel1id")int wheel1id);

	//	通过stockid得到所有翻新轮胎信息
	List<Map<String,Object>> getRenovatedTyreByStockid(@Param("stockid")int stockid);

	//	通过stockid得到所有配送轮胎信息
	List<Map<String,Object>>getDistributionTireByStockid(@Param("stockid")int stockid);

	int tireOutgoing(@Param("tireid")int tireid,@Param("aimid") int aimid);
//	翻新入库
	int renovatedTire(@Param("tireid") int tireid);
//配送入库
	int distributionTire(@Param("tireid") int tireid);
}
